package org.iabako.client.ui.page.business.client;

import com.google.gwt.user.client.Timer;
import org.iabako.client.config.page.PageConfigEnum;
import org.iabako.client.navigation.NavigationController;
import org.iabako.client.ui.form.AbstractForm;
import org.iabako.client.ui.form.business.client.ClientForm;
import org.iabako.shared.exception.IabakoPackageForbiddenException;

/**
 * TODO javadoc
 * Date: 24/11/13
 * Time: 18:22
 */
public class ClientCreate extends ClientForm {

    public ClientCreate(AbstractForm abstractForm) {
        super(PageConfigEnum.ClientCreate, "", true);

        parentForm = abstractForm;

        if (parentForm != null) {
            popup.timerAfterClosePopupAnimation = new Timer() {
                public void run() {
                    NavigationController.getInstance().closePopup(simplePopup);
                    NavigationController.getInstance().goTo(parentForm);
                }
            };

            clientInformationForm.messages.showSuccessMessage("validation_add_new_client_message");
        }
    }

}
